package com.pengtu.entity.asset.book;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Where;

import com.pengtu.entity.IdEntity;
import com.pengtu.entity.app.Department;

@Entity
@Table(name = "T_ASST_BK_INFO")
public class BkInformation extends IdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String bookType; // 图书类型
	private String bookName; // 图书名称
	private String bookNo; // 图书编号
	private String stored; // 存放处
	private String edit; // 作者
	private String publisher; // 出版社
	private String price; // 价格
	private Date publicationDate; // 出版时间
	private String remark; // 内容简介
	private Department department; // 所属部门
	private Set<BkSn> bksnList = new HashSet<BkSn>(); // 借出信息
	private Date effectiveDate; //实施时间
	private String sindex; //上架号

	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(insertable = true, updatable = true, name = "DEPTID")
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "BOOKTYPE")
	public String getBookType() {
		return bookType;
	}

	public void setBookType(String bookType) {
		this.bookType = bookType;
	}

	@Column(name = "BOOKNAME")
	public String getBookName() {
		return bookName;
	}

	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	@Column(name = "BOOKNO", unique = true)
	public String getBookNo() {
		return bookNo;
	}

	public void setBookNo(String bookNo) {
		this.bookNo = bookNo;
	}

	@Column(name = "STORED")
	public String getStored() {
		return stored;
	}

	public void setStored(String stored) {
		this.stored = stored;
	}

	@Column(name = "EDIT")
	public String getEdit() {
		return edit;
	}

	public void setEdit(String edit) {
		this.edit = edit;
	}

	@Column(name = "PUBLISHER")
	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	@Column(name = "PRICE")
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "PUBLICATIONDATE")
	public Date getPublicationDate() {
		return publicationDate;
	}

	public void setPublicationDate(Date publicationDate) {
		this.publicationDate = publicationDate;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	
	@OneToMany(mappedBy="bookinfo",fetch=FetchType.LAZY)
	@Where(clause=" delFlag = 0 ")
	public Set<BkSn> getBksnList() {
		return bksnList;
	}

	public void setBksnList(Set<BkSn> bksnList) {
		this.bksnList = bksnList;
	}
	
	@Column(name="EFFECTIVEDATE")
	public Date getEffectiveDate() {
		return effectiveDate;
	}

	public void setEffectiveDate(Date effectiveDate) {
		this.effectiveDate = effectiveDate;
	}
	
	@Column(name="SINDEX")
	public String getSindex() {
		return sindex;
	}

	public void setSindex(String sindex) {
		this.sindex = sindex;
	}

	public BkInformation() {
		super();
	}

}
